/**
 *  fileName:test_asign
 *  time:2021/12/30
 *  todo:$END$
 */
let a = [
  {
    name: 'hello',
    path: 'a/b/c',
    extend: true
  },
  {
    name: 'hello2',
    path: 'a/b/c2',
    extend: true
  }
]
let b = [
  {
    name: 'hi',
    path: 'a/b/c'
  },
  {
    name: 'hi2',
    path: 'a/b/d'
  }
]

let cc = Object.assign(a[0], b[0])

console.log(`cc ==> `, cc)
a = Object.assign(a, b)
let path_list = []
for (const bKey in b) {
  path_list.push(b[bKey].path)
}
for (const aKey in a) {
  if(!path_list.includes(a[aKey].path)){
    a.splice(aKey,1)
  }
}


let c = Object.assign(a, b)
console.log(`c ==> `, c)
